<template>
  <div>
    <Header></Header>

    <!--banner-->
    <div class="banner">
      <div class="wrapper clearfix">
        <div class="celeInfo-left">
          <div class="avatar-shadow">
            <img class="avatar" :src="movedetail.poster" alt="" />
            <div class="movie-ver">
              <i class="imax2d">{{ movedetail.item.name }}</i>
            </div>
          </div>
        </div>
        <div class="celeInfo-right clearfix">
          <div class="movie-brief-container">
            <h1 class="name">{{ movedetail.name }}</h1>
            <div class="ename ellipsis">Embrace Again</div>
            <ul>
              <li class="ellipsis">
                <a class="text-link" href="">{{ movedetail.category }}</a>
              </li>
              <li class="ellipsis">
                {{ movedetail.nation }} /
                {{ movedetail.premiereAt | dateFilter }}分钟
              </li>
              <li class="ellipsis">
                {{ movedetail.premiereAt | dateFilter
                }}{{ movedetail.nation }}上映
              </li>
            </ul>
          </div>
          <div class="action-buyBtn">
            <div class="action clearfix">
              <a href="" class="wish">
                <div>
                  <i class="icon wish-icon"></i>
                  <span class="wish-msg">想看</span>
                </div>
              </a>
              <a href="" class="score-btn">
                <i class="icon score-btn-icon"></i>
                <span class="score-btn-msg">评分</span>
              </a>
            </div>
            <a class="btn buy" href="">特惠购票</a>
          </div>
          <div class="movie-stats-container">
            <div class="movie-index">
              <p class="movie-index-title">猫眼口碑</p>
              <div class="movie-index-content score normal-score">
                <span class="index-left info-num">
                  <span class="stonefont"> ?? </span>
                </span>
                <div class="index-right">
                  <div class="star-wrapper">
                    <div class="star-on" style="width: 95%"></div>
                  </div>
                </div>
                <span class="score-num">
                  <span class="stonefont">??万</span>
                  人评分
                </span>
              </div>
            </div>
            <div class="movie-index">
              <p class="movie-index-title">累计票房</p>
              <div class="movie-index-content box">
                <span class="stonwfont">??</span>
                <span class="unit">亿</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!--主体-->
    <!-- container -->
    <div class="container">
      <div class="tags-panel">
        <ul class="tags-lines">
          <li class="tags-line">
            <div class="tags-title">品牌:</div>
            <ul class="tags">
              <li class="active">
                <a href="">全部</a>
              </li>
            </ul>
          </li>
          <li class="tags-line tags-line-border">
            <div class="tags-title">行政区:</div>
            <ul class="tags">
              <li class="active">
                <a href="">全部</a>
              </li>
            </ul>
          </li>
          <li class="tags-line tags-line-border">
            <div class="tags-title">影厅类型:</div>
            <ul class="tags">
              <li class="active">
                <a href="">全部</a>
              </li>
            </ul>
          </li>
          <li class="tags-line tags-line-border">
            <div class="tags-title">影院服务:</div>
            <ul class="tags">
              <li class="active">
                <a href="">全部</a>
              </li>
            </ul>
          </li>
        </ul>
      </div>
      <div class="cinemas-list">
        <h2 class="cinemas-list-header">
          <span>影院列表</span>
          <div class="cinemas-list-filter">
            <span class="cinemas-list-filter-title">
              <img src="../assets/cinema/1.png" alt="" />
              筛选
            </span>
            <ul class="cinemas-list-filter-info">
              <li class="filter-item">
                <a href="">距离近</a>
              </li>
              <li class="filter-item">
                <a href="">价格低</a>
              </li>
            </ul>
          </div>
        </h2>
        <div
          class="cinema-cell"
          v-for="item in cinemalist"
          :key="item.cinemaId"
        >
          <div class="cinema-info">
            <a
              class="cinema-name"
              data-act="cinema-name-click"
              data-bid="b_4tkpau4m"
              data-val="{city_id: , cinema_id: 154}"
              @cilck="gotocinemadetail(item.cinemaId)"
              >{{ item.name }}</a
            >
            <p class="cinema-address">
              {{ item.address }}
            </p>
            <div class="cinema-tags">
              <span class="cinema-tags-item">退</span>

              <span class="cinema-tags-item">改签</span>

              <span class="cinema-tags-item">折扣卡</span>
            </div>
          </div>
          <div class="buy-btn">
            <a
              data-act="buy-btn-click"
              data-val="{city_id: , cinema_id: 154}"
              data-bid="b_4tkpau4m"
              @click="gotocinemadetail(item.cinemaId)"
              >选座购票</a
            >
          </div>

          <div class="price">
            <span class="rmb red">￥</span>
            <span class="price-num red"
              ><span class="stonefont">{{ item.lowPrice / 100.0 }}</span></span
            >
            <span>起</span>
          </div>
        </div>
      </div>
    </div>
    <el-pagination
      background
      layout="total, sizes, prev, pager, next, jumper"
      :total="cinemalist.length"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :page-size="12"
    >
    </el-pagination>
    <low></low>
  </div>
</template>

<script>
import low from "../components/low";
import Header from "../components/Header";
import http from "../api/http";
import moment from "moment";
export default {
  name: "cinema",
  components: {
    low,
    Header
  },
  data() {
    return {
      cinemalist: [],
      movedetail: null
    };
  },
  mounted() {
    http({
      url: `/gateway?cityId=${this.$store.state.cityId}&ticketFlag=1&k=7845835`,
      headers: {
        "X-Host": "mall.film-ticket.cinema.list"
      }
    }).then(res => {
      if (res.status == 0) {
        console.log(res.data);
        this.cinemalist = res.data.cinemas;
      }
    });
    http({
      url: `gateway?filmId=${this.$route.params.myid}&k=3869895`,
      headers: {
        "X-Host": "mall.film-ticket.film.info"
      }
    }).then(res => {
      if (res.status == 0) {
        console.log(res.data);
        let { film } = res.data;
        this.movedetail = film;
      }
    });
  },
  methods: {
    handleSizeChange() {},
    handleCurrentChange() {},
    gotocinemadetail(id) {
      this.$router.push({
        path: "/cinemadetail",
        query: { id: id, myid: this.$route.params.myid }
      });
    }
  },
  filters: {
    dateFilter(date) {
      return moment(date * 1000).format("YYYY-MM-DD");
    }
  }
};
</script>

<style scoped>
/* banner*/

.banner {
  width: 100%;
  min-width: 1200px;
  background: #392f59 url(../assets/detail/1.png) no-repeat 50%;
}
.banner .wrapper {
  width: 1200px;
  margin: 0 auto;
  height: 376px;
  position: relative;
}
.clearfix:after,
.clearfix:before {
  content: " ";
  display: table;
}
.banner .wrapper .celeInfo-left {
  width: 300px;
  float: left;
  position: relative;
  top: 70px;
  overflow: hidden;
  z-index: 9;
}
.celeInfo-left .avatar-shadow,
.cinema-left .avatar-shadow {
  position: relative;
  margin: 0 30px;
  width: 240px;
  height: 330px;
  padding-bottom: 40px;
  background: url(../assets/detail/2.png) no-repeat bottom;
}
.celeInfo-left .avatar-shadow .avatar {
  border: 4px solid #fff;
  height: 322px;
  width: 232px;
}
img {
  border-style: none;
}
.movie-ver {
  position: absolute;
  top: 4px;
  left: -2px;
  font-size: 12px;
  color: #fff;
}
.movie-ver i.imax2d {
  width: 69px;
  height: 25px;
  background-color: skyblue;
}
.movie-ver i {
  display: inline-block;
}
i {
  font-style: italic;
}
.banner .wrapper .celeInfo-right {
  position: relative;
  margin-right: 30px;
  margin-left: 300px;
  margin-top: 70px;
}
.movie-brief-container {
  position: absolute;
  color: #fff;
  font-size: 14px;
  z-index: 1;
}
.movie-brief-container .name {
  width: 900px;
  margin-top: 0;
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 64px;
}
.movie-brief-container .ename {
  width: 340px;
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 14px;
}
.ellipsis {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.movie-brief-container ul {
  width: 250px;
  list-style: none;
  padding-left: 0;
  margin-bottom: 20px;
}
.movie-brief-container ul li {
  margin: 12px 0;
  line-height: 100%;
}
.movie-brief-container a.text-link {
  color: inherit;
}
.action-buyBtn {
  position: absolute;
  bottom: 20px;
}
.action-buyBtn .btn.buy {
  margin-top: 10px;
  width: 250px;
  height: 40px;
  font-size: 16px;
  line-height: 40px;
  text-align: center;
  border-radius: 2px;
  padding: 0;
}
.btn {
  display: inline-block;
  padding: 2px 15px;
  line-height: 25px;
  font-size: 15px;
  color: #fff;
  background-color: #df2d2d;
}
.action-buyBtn .action a {
  cursor: pointer;
  float: left;
  display: block;
  width: 120px;
  height: 25px;
  background-color: #756189;
  margin-right: 10px;
  padding-top: 11px;
  text-align: center;
  font-size: 14px;
  line-height: 16px;
  color: #fff;
  border-radius: 2px;
}
.action-buyBtn .action .wish i.wish-icon {
  background: url(../assets/detail/4.png);
}
.action-buyBtn .action i.icon {
  display: inline-block;
  vertical-align: middle;
  margin-top: -2px;
  margin-right: 2px;
  width: 16px;
  height: 16px;
}
.action-buyBtn .action .score-btn i.score-btn-icon {
  background: url(../assets/detail/5.png);
}
.clearfix:after {
  clear: both;
}
.movie-stats-container {
  position: absolute;
  top: 158px;
  left: 342px;
}
.movie-stats-container .movie-index .movie-index-title {
  font-size: 12px;
  margin-bottom: 8px;
}
.movie-stats-container .movie-index .movie-index-content {
  overflow: hidden;
}
.movie-stats-container .movie-index .movie-index-content .index-left {
  float: left;
}
.movie-stats-container .movie-index .movie-index-content .info-num {
  font-size: 30px;
  color: #ffc600;
  height: 30px;
  line-height: 30px;
}
.stonefont {
  font-family: stonefont;
}
.movie-stats-container .movie-index .movie-index-content .index-right {
  margin-left: 54px;
  font-size: 12px;
}
.movie-stats-container .movie-index .movie-index-content .star-wrapper {
  width: 60px;
  height: 12px;
  position: relative;
  background-image: url(../assets/detail/6.png);
  background-repeat: repeat-x;
  margin-bottom: 4px;
}
.movie-stats-container .movie-index {
  margin-bottom: 16px;
  color: #fff;
}
.movie-stats-container .movie-index .movie-index-content {
  overflow: hidden;
}
.movie-stats-container .movie-index .box .stonefont {
  font-size: 30px;
}
.movie-stats-container .movie-index .box .unit {
  font-size: 12px;
  padding-left: 4px;
}

.el-pagination {
  text-align: center;
  margin-top: 15px;
}

/* container 中的标题 */
.container {
  width: 1200px;
  margin: 0 auto;
}
.tags-panel {
  border: 1px solid #e5e5e5;
  padding: 0 20px;
  margin: 40px 0;
  position: relative;
}
.tags-title {
  height: 24px;
  line-height: 24px;
  float: left;
  color: #999;
  font-size: 14px;
}
.tags-line {
  padding: 10px 0 !important;
}
.tags-panel ul.tags {
  margin-left: 40px;
}
.tags li.active {
  background: #f34d41;
  color: #fff;
}
.tags li {
  border-radius: 14px;
  padding: 3px 9px;
  display: inline-block;
  margin-left: 12px;
}
.tags li.active a {
  color: #fff;
}
.tags li a {
  color: #333;
  font-size: 14px;
}
.tags-line-border {
  border-top: 1px dashed #e5e5e5;
}

/* 列表 */
.cinemas-list .cinemas-list-header {
  font-size: 18px;
  color: #333;
  border-left: 4px solid #f03d37;
  padding-left: 6px;
  line-height: 18px;
  margin: 0;
  position: relative;
}
.cinemas-list .cinemas-list-filter {
  font-family: PingFangSC-Regular;
  font-size: 13px;
  color: #666;
  letter-spacing: 0;
  font-weight: 400;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  background: #fff;
}
.cinemas-list .cinemas-list-filter-title {
  display: block;
  width: 70px;
  margin-bottom: 8px;
  padding-left: 10px;
}
.cinemas-list .cinemas-list-filter-title img {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-top: -2px;
}
.cinemas-list .cinemas-list-filter-info {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 56px;
  text-align: center;
}
.cinemas-list .cinemas-list-filter-info .filter-item {
  height: 28px;
  margin: 0;
  line-height: 28px;
  width: 64px;
  padding-left: 16px;
}
.cinemas-list .cinemas-list-filter-info .filter-item a {
  color: #666;
}
/* 列表 */
.cinemas-list .cinema-cell {
  display: block;
  padding: 20px 0;
  border-bottom: 1px dashed #e5e5e5;
}
.cinemas-list .cinema-info {
  display: inline-block;
  max-width: 80%;
}
.cinemas-list .cinema-name {
  display: inline-block;
  font-size: 16px;
  line-height: 18px;
  color: #333;
  margin-bottom: 10px;
}
.cinemas-list .cinema-address {
  font-size: 14px;
  line-height: 14px;
  color: #999;
}
.cinemas-list .cinema-tags {
  margin-top: 10px;
  font-family: PingFangSC-Regular;
  font-size: 12px;
  color: #509fc9;
  line-height: 18px;
}
.cinemas-list .cinema-tags span.cinema-tags-item {
  display: inline-block;
  border: 0.7px solid #509fc9;
  border-radius: 3px;
  padding: 0 2px;
  margin-right: 8px;
}
.cinemas-list .buy-btn {
  float: right;
  width: 80px;
  height: 45px;
  line-height: 45px;
  margin-left: 36px;
  margin-right: 20px;
}
.cinemas-list .buy-btn a {
  display: inline-block;
  width: 100%;
  height: 30px;
  color: #fff;
  background-color: #f03d37;
  font-size: 14px;
  line-height: 30px;
  border-radius: 100px;
  text-align: center;
  -webkit-box-shadow: 0 2px 10px -2px #f03d37;
  box-shadow: 0 2px 10px -2px #f03d37;
}
.cinemas-list .price {
  float: right;
  font-size: 12px;
  color: #999;
  height: 45px;
  line-height: 45px;
}
.cinemas-list .price .rmb {
  margin-right: -4px;
}
.red {
  color: #f03d37;
}
.cinemas-list .price .price-num {
  font-size: 16px;
  margin-right: -3px;
  font-weight: 700;
}
.stonefont {
  font-family: stonefont;
}
</style>
